package com.leejie.mapper;

import com.leejie.config.DataSource;
import com.leejie.config.DataSourceType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

@Repository
public interface HelloDao {
    @DataSource(value = DataSourceType.db1)
    @Select("select * from user")
    List<HashMap<String,Object>> selectUser();

    @DataSource(value = DataSourceType.db2)
    @Insert("insert into log (logMsg) values(#{log})")
    Integer insertLog(String log);
}
